package com.vcredit.creditcat.web;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import com.vcredit.creditcat.model.ProcessSpecialCondition;
import com.vcredit.creditcat.vo.ProcessSpecialConditionVo;
import com.vcredit.creditcat.service.ProcessSpecialConditionService;
import com.vcredit.creditcat.framework.pagination.Page;
 /*
  * @author zhangxingong
  * @version 1.0
  * @since 1.0
 */
@RestController
@RequestMapping("/processSpecialCondition")
public class ProcessSpecialConditionController extends BaseController {
    
    @Autowired
    private ProcessSpecialConditionService processSpecialConditionService;
  
    @RequestMapping(value = "/list")
    public ModelAndView  showPageProcessSpecialCondition(HttpServletRequest request) {
        return new ModelAndView("processspecialcondition/processSpecialConditionList");
    }  
	
	@RequestMapping(value = "/listProcessSpecialCondition", method = RequestMethod.GET)
	public Page<ProcessSpecialCondition> findByPageProcessSpecialCondition(HttpServletRequest request) {
      return processSpecialConditionService.findByPage(makeDefaultCriteria(request));
	}
	
	@RequestMapping(value = "/saveProcessSpecialCondition", method = RequestMethod.POST)
	public String saveProcessSpecialCondition(@RequestBody ProcessSpecialConditionVo processSpecialConditionVo,HttpServletRequest request) {
	    processSpecialConditionService.save(processSpecialConditionVo);
		return SUCCESS;
	}
	   
    @RequestMapping(value = "/updateProcessSpecialCondition", method = RequestMethod.PUT)
    public String updateProcessSpecialCondition(@RequestBody ProcessSpecialCondition processSpecialCondition,HttpServletRequest request) {
        processSpecialConditionService.update(processSpecialCondition);
        return SUCCESS;
    }
    
    @RequestMapping(value = "/removeProcessSpecialCondition", method = RequestMethod.DELETE)
    public String removeProcessSpecialCondition(@RequestParam("ids") String ids ,HttpServletRequest request) {
        processSpecialConditionService.removeProcessSpecialCondition(ids);
        return SUCCESS;
    }	
}
